import request from '@/utils/http'

// 根据一级分类id获取二级分类
export function getCategoryById(id) {
  return request.get(`/category/?id=${id}`)
}

/**
 * @description: 获取二级分类列表数据
 * @param {*} id 分类id
 * @return {*}
 */

export const getCategoryFilterAPI = (id) => {
  return request({
    url: '/category/sub/filter',
    params: {
      id
    }
  })
}

// 获取二级分类下的商品列表
export const getSubCategoryAPI = (data) => {
  return request({
    url: '/category/goods/temporary',
    method: 'POST',
    data
  })
}
